package com.varton.adapter;

/**
 *
 * @author varton
 */
public class IpParser implements BelongParser {
    @Override
    public String parser(String context) {
        if (context.matches("^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$")){
            return "ipv4 - guang zhou";
        }else {
            return new BelongAdapater().parser(context);
        }
    }
}